<template>
    <div class="head_page">
      <van-nav-bar title="设置备注和标签" left-arrow @click-left="$router.back()"/>
        
        <div class="content">
            <div class="list">
                <div class='title'>备注</div>
                <div class="input">
                    <textarea v-model='remark' class="textare" placeholder="输入备注" rows="1"></textarea>
                </div>
            </div>
            <div class="list tel">
                <div class='title'>电话号码</div>
                <div class="input">
                    <input class="tel" type="number" v-model='Mobile'>
                </div>
            </div>
            <van-button @click='setRemarkClick' color='rgb(0,126,254)' size="large" type="primary">提交</van-button>
        </div>
    </div>
</template>

<script>
  import {Toast} from 'vant'
  export default {
    name: 'reCharge',
    data(){
      return {
        SendUserId:'',
        Mobile:'',
        remark:''
      }
    },
    components:{
     
    },
    mounted(){
        this.remark = this.$route.params.userDetail.remark || ''
        this.Mobile = this.$route.params.userDetail.mobile1 || ''
        this.SendUserId = this.$route.params.userDetail.id
    },
    methods:{
      setRemarkClick(){
        let _self = this
        const userInfo = JSON.parse(localStorage.getItem('userInfo')) || ''
        let params = {
          addUserId:userInfo.id,   //当前用户id
          Mobile:_self.Mobile,
          addedUserId:_self.SendUserId,
          remark:_self.remark
        }
        _self.$api.user.SetFirendRemark(params).then(res => {
              if (res.code === 200) {
                Toast(res.data)
                setTimeout(function(){
                  _self.$router.go(-1)
                },1000)
              }
          })
      }
    
       
        
    },
     

  }
</script>
<style lang="scss" scoped>
.head_page{
    width:100%;
    height:100%;
    position: absolute;
    background: #fff;
    .content{
        width:80%;
        margin:0 auto;
        margin-top:50px;
        .list{
            margin-bottom: 10px;
            .title{
                font-size: 14px;
                height:25px;
                line-height:25px;
            }
            .input{
                width:100%;
                height:40px;
                line-height: 40px;
                border-radius: 10px;
                .textare{
                    padding-left: 10px;
                    font-size:14px;
                    width:100%;
                    height:100%;
                    border:none;
                    background: rgb(247,247,247);
                    border-radius: 10px;
                }
                .tel{
                    padding-left: 10px;
                    font-size:14px;
                    width:100%;
                    height:100%;
                    border:none;
                    background: rgb(247,247,247);
                }
            }
        }
        .tel{
            margin-bottom: 100px;
        }
    }
}

</style>
